<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>API 文档</title>
	<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/monokai-sublime.min.css" rel="stylesheet">
	<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>  
	<script type="text/javascript">hljs.initHighlightingOnLoad();</script>
	<style type="text/css">
		*{ margin: 0;padding: 0;}
		html,body{height: 100%;padding:10px 30px;overflow: hidden;}
		pre,code {font-family: "consolas";font-size: 16px;height: calc(100% - 25px);}
		.javaScript{overflow: auto;border-left:50px solid #333;}
		::-webkit-scrollbar {
		    width: 6px;
		    background-color: #F5F5F5;
		}
		::-webkit-scrollbar-thumb {
		    background-color: #999;
		}
		::-webkit-scrollbar-track {
		    background-color: #F5F5F5;
		}
	</style>
</head>
<body>
<pre>
<code class="javaScript">
/**
 * [ 基本说明 ]
 */
url = "https://www.finalove.top/api/{$controller}/{$action}";
http_body = {
	// key是接口密钥
	"key":"481a17a665f76c0d55e3483624f423ea",
	// 参数
	"params":{
		"number":123,
		"string":"bbb",
		"array":[1,2,3]
	}
}
return = {
	"code":1,
	"msg":"this is message",
	"data":"this is data"
}

/**
 * [ 首页轮播图数据 ]
 */
url =  "https://www.finalove.top/api/index/getSwipeData";
params = null;
return = {
	"code":1,
	"msg":"ok",
	"data":[{
		"link":"###",
		"img":"../resource/img/0.jpg",
		"remark":"remark"=>"这个是一段文字0"
	},{
		"link":"###",
		"img":"../resource/img/1.jpg",
		"remark":"remark"=>"这个是一段文字1"
	}]
}

/**
 * [ 获取用户数据 ]
 */
url =  "https://www.finalove.top/api/index/getUserInfo";
params = {
	"id":1
}
return = {
	"id":1,
	"user_name":"test_user",
	"nick_name":"测试用户",
	"email":"qq@qq.qq",
	"head":"https://www.finalove.top/upload/userhead/1234567.jpg"
}

/**
 * [ 保存用户基本信息 ]
 */
url =  "https://www.finalove.top/api/index/saveVisitorBaseInfo";
params = {
	"id":1,
	"nick_name":"修改的昵称"
}
return = {
	"code":1,
	"msg":"保存成功",
	"data":""
}

/**
 * [ 登陆 ]
 */
url =  "https://www.finalove.top/api/login/doLogin";
params = {
	"user_name":"test_user",
	"passwd":"111111"
}
return = {
	"code":1,
	"msg":"登录成功",
	"data":{
		"user_id":1,
		"user_name":"test_user",
		"user_head":"https://www.finalove.top/upload/userhead/156754654.jpg"
	}
}

/**
 * [ 注册 ]
 */
url =  "https://www.finalove.top/api/login/register";
params = {
	"user_name":"test_user",
	"email":"qq@qq.qq",
	"email_code":"123456",
	"passwd":"1111111",
	"repasswd":"1111111",
}
return = {
	"code":1,
	"msg":"注册成功",
	"data":{
		"user_id":1,
		"user_name":"test_user",
		"user_head":"https://www.finalove.top/upload/userhead/156754654.jpg"
	}
}

/**
 * [ 获取邮箱验证码 ]
 */
url = "https://www.finalove.top/api/login/getEmailCode";
params = {
	"email":"qq@qq.qq"
}
return = {
	"code":1,
	"msg":"邮件发送成功，请尽快登陆邮箱，获取验证码，完成操作"
}

/**
 * [ 获取好友详情 ]
 */
url = "https://www.finalove.top/api/friend/getFriendsInfoById";
params = {
	// 所属用户ID
	"belong_to":123,
	// 好友ID
	"friend_id":456
}
return = {
	"code":1,
	"msg":"ok",
	"data":{
		"user_name":"test_user",
		"email":"qq@qq.qq",
		"remark_name":"撒打发发达"
	}
}

/**
 * [ 获取好友申请列表 ]
 */
url = "https://www.finalove.top/api/friend/getApplyList";
params = {
	// 用户ID
	"user_id":123,
}
return = {
	"code":1,
	"msg":"ok",
	"data":{
		"apply_id":123,
		// 备注名称
		"remark":"啊打发打发",
		// 好友ID
		"visitor_id":23,
		// 好友昵称
		"nick_name":"撒旦发射点",
		// 头像
		"head":"https://www.finalove.top/upload/head.jpg"
	}
}

/**
 * [ 好友申请 ]
 */
url = "https://www.finalove.top/api/friend/friendApply";
params = {
	// 请求者用户ID
	"from_id":123,
	// 被添加者ID
	"to_id":456
}
return = {
	"code":1,
	"msg":"申请已发出",
	"data":""
}


/**
 * [ 同意好友申请 ]
 */
url = "https://www.finalove.top/api/friend/agreeApply";
params = {
	// 请求者用户ID
	"from_id":123,
	// 被添加者ID
	"to_id":456
}
return = {
	"code":1,
	"msg":"已同意",
	"data":""
}

/**
 * [ 拒绝好友申请 ]
 */
url = "https://www.finalove.top/api/friend/disagreeApply";
params = {
	// 请求者用户ID
	"from_id":123,
	// 被添加者ID
	"to_id":456
}
return = {
	"code":1,
	"msg":"已拒绝",
	"data":""
}

/**
 * [ 修改好友备注 ]
 */
url = "https://www.finalove.top/api/friend/editRemarkName";
params = {
	// 所属用户ID
	"belong_to":123,
	// 好友ID
	"friend_id":456,
	// 备注名称
	"remark_name":"奥省的首府"
}
return = {
	"code":1,
	"msg":"修改成功",
	"data":""
}

/**
 * [ 删除好友 ]
 */
url = "https://www.finalove.top/api/friend/delFriend";
params = {
	// 互相好友其中一人ID
	"visitor_id_0":123,
	// 互相好友另一人ID
	"visitor_id_1":456,
}
return = {
	"code":1,
	"msg":"删除成功",
	"data":""
}




</code>
</pre>
</body>
<script type="text/javascript">
var Catalog = {
	"index":{
		"首页轮播图数据":"index/getSwipeData",
		"获取用户数据":"index/getUserInfo",
		"保存用户基本信息":"index/saveVisitorBaseInfo",
	},
	"friend":{
		"获取好友列表":"friend/getFriendsList",
		"获取好友详情":"friend/getFriendsInfoById",
		"获取好友申请列表":"friend/getApplyList",
		"好友申请":"friend/friendApply",
		"同意好友申请":"friend/agreeApply",
		"拒绝好友申请":"friend/disagreeApply",
		"修改好友备注":"friend/editRemarkName",
		"删除好友":"friend/delFriend",
	},
	"login":{
		"登陆":"login/doLogin",
		"注册":"login/register",
		"获取邮箱验证码":"login/getEmailCode"
	},
	"other":{
		"基本说明":"https://www.finalove.top/api/{$controller}/{$action}",
		"测试接口":"api/index/test",
		"头像上传":"index/index/uploadHeadByClient",
		"二维码加好友":"index/index/applyByQRcode",
		"app版本检测":"app_version.json?t=time"
	}
}
for(i in Catalog){
	console.log("#########################【 " + i + " 】#########################");
	console.table(Catalog[i]);
}
</script>
</html>